package com.lanou.quanttrade.stock.mapper;

import com.lanou.quanttrade.stock.javabean.MemberDailyStrategy;
import com.lanou.quanttrade.stock.javabean.MemberDailyStrategyTable;
import com.lanou.quanttrade.stock.javabean.MemberDailyStrategyTableItem;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface MemberDailyStrategyMapper {

    /**
     * 保存策略信息，并自动填充主键
     * @param memberDailyStrategy
     * @return
     */
    int saveMemberDailyStrategy(@Param("mds") MemberDailyStrategy memberDailyStrategy);

    /**
     * 保存策略对应的策略展示表
     * @param memberDailyStrategyTable
     * @return
     */
    int saveMemberDailyStrategyTable(@Param("mdst") MemberDailyStrategyTable memberDailyStrategyTable);

    /**
     * 保存某策略表的一系列表头
     * @param memberDailyStrategyTable
     * @return
     */
    int saveMemberDailyStrategyTableItems(@Param("mdst") MemberDailyStrategyTable memberDailyStrategyTable);

    /**
     * 根据mid查询某个用户的策略列表
     * @param mid
     * @return
     */
    List<MemberDailyStrategyTable> getMemberDailyStrategysThroughMid(@Param("mid") Integer mid);

    /**
     * 根据tid查询某个列表的表头信息
     * @param tid
     * @return
     */
    List<MemberDailyStrategyTableItem>getMemberDailyStrategyItemsThroughTid(@Param("tid")Integer tid);

    /**
     * 根据策略列表id 反查策略信息
     * @param tbid
     * @return
     */
    MemberDailyStrategy getMemberDailyStrategyThroughTbId(@Param("tbid") Integer tbid);

    /**
     * 根据策略参数，查询符合要求的日线平均值信息
     * @param memberDailyStrategy
     * @return
     */
    List<Map> getMrDailyResultsThroughParam(@Param("mds") MemberDailyStrategy memberDailyStrategy);
}
